<template>
  <div class="reslut">
    <van-nav-bar title="支付结果" left-text="" left-arrow fixed placeholder />
    <div class="paysuccess">
      <van-icon name="alipay" size="140" color="rgb(34,107,243)" />
      <span>{{ msg }}</span>
    </div>
    <div class="btn">
      <van-button type="primary" block to="tobeshipped">返回</van-button>
    </div>
    <!-- <router-link to="/tobeshipped">首页</router-link> -->
  </div>
</template>

<script>
export default {
  created() {
    this.getData()
  },

  data() {
    return {
      msg: "",
    }
  },

  methods: {
    getData() {
      let params = {
        out_trade_no: this.$route.query.out_trade_no,
        trade_no: this.$route.query.trade_no,
      }

      this.$api.pay.payReslut(params).then((res) => {
        console.log(res)
        this.msg = res.data.msg || res.msg
      })
    },
  },
}
</script>

<style lang="less" scoped>
.paysuccess {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;

  span {
    font-size: 20px;
  }
}

.btn {
  width: 90vw;
  margin: 10px auto;
}
</style>
